Skip to content

encoding/json: increment byte counter when using decoder.Token #43716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

ggaaooppeenngg
Copy link
Contributor

@ggaaooppeenngg ggaaooppeenngg commented Jan 15, 2021

At every iteration of decoder.Token, scaner.bytes does not increment
when it meets spaces and other non value token.

Fixes #34543.

@google-cla google-cla bot added the cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change. label Jan 15, 2021
@gopherbot
Copy link
Contributor

This PR (HEAD: 97cb782) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/284078 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Daniel Martí:

Patch Set 1: Code-Review+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@mvdan mvdan changed the title encoding/json: fix byte counter increments when using decoder.Token() encoding/json: increment byte counter when using decoder.Token Mar 30, 2021
At every iteration of decoder.Token(), scaner.bytes does not increment
when it meets spaces and other non value token.

Signed-off-by: Peng Gao <[email protected]>
Change-Id: Id41b7e22e2c45fffc7fafacd618724f0f214dd2f
@mvdan mvdan force-pushed the fix-json-encoding branch from 97cb782 to 4cf3ee9 Compare March 30, 2021 17:22
@gopherbot
Copy link
Contributor

Message from Daniel Martí:

Patch Set 1: Run-TryBot+1 Code-Review+2 Trust+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 4cf3ee9) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/go/+/284078 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Daniel Martí:

Patch Set 2: Run-TryBot+1 Code-Review+2 Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 2:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=8d5d7856


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Daniel Martí:

Patch Set 3: Run-TryBot+1 Code-Review+2 Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=38b5b143


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Heschi Kreinick:

Patch Set 3: Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Joe Tsai:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Peng Gao:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Joe Tsai:

Patch Set 3:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Alexander Yastrebov:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Daniel Martí:

Patch Set 1: Code-Review+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Daniel Martí:

Patch Set 1: Run-TryBot+1 Code-Review+2 Trust+1

(2 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Daniel Martí:

Patch Set 2: Run-TryBot+1 Code-Review+2 Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 2:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=8d5d7856


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Daniel Martí:

Patch Set 3: Run-TryBot+1 Code-Review+2 Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3:

TryBots beginning. Status page: https://farmer.golang.org/try?commit=38b5b143


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Heschi Kreinick:

Patch Set 3: Trust+1


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Go Bot:

Patch Set 3: TryBot-Result+1

TryBots are happy.


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Joe Tsai:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Peng Gao:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Joe Tsai:

Patch Set 3:

(4 comments)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Alexander Yastrebov:

Patch Set 3:

(1 comment)


Please don’t reply on this GitHub thread. Visit golang.org/cl/284078.
After addressing review feedback, remember to publish your drafts!

@seankhliao seankhliao closed this Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Used by googlebot to label PRs as having a valid CLA. The text of this label should not change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

encoding/json: Unmarshal & json.(*Decoder).Token report different values for SyntaxError.Offset for the same input
3 participants